package farmaciaweb.com.br.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class Cep implements Serializable {
	private static final long serialVersionUID = -3054719386022926805L;
	
	@Column(nullable = false, length = 8)
	private String numCep;

	public Cep() {
		super();
	}   
	public String getNumCep() {
		return this.numCep;
	}

	public void setNumCep(String numCep) {
		this.numCep = numCep;
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((numCep == null) ? 0 : numCep.hashCode());
		return result;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Cep other = (Cep) obj;
		if (numCep == null) {
			if (other.numCep != null)
				return false;
		} else if (!numCep.equals(other.numCep))
			return false;
		return true;
	}
}